package com.kede.ienum;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 ** @Author:Pr.li
 ** @Description:推荐:index=首页,hot=热门,recommend=推荐,new=最新
 ** @Date: create in 2023/5/15 23:02
 ***/
@Getter
@AllArgsConstructor
public enum FlagEnum {
    INDEX("index","首页",1),
    HOT("hot","热门",2),
    RECOMMEND("recommend","推荐",3),
    NEW("new","最新",4);


    @EnumValue
    private String code;
    private String value;
    private Integer enumIndex;

    public static FlagEnum parse(String code) {
        for (FlagEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

}
